<?php
class page extends core{
	public function header($title = ""){
		global $phprpg,$module;
		if($title == ""){
			$title = $phprpg->settings['gamename'];
		}
		echo <<<OUT
<!DOCTYPE html>
<html lang="en"><head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
	<title>{$title}</title>

	<link href="./bootstrap.css" rel="stylesheet">
	<style type="text/css">
		body {
			padding-top: 60px;
		}
	</style>

	</head>

	<body>

	<div class="topbar">
		<div class="topbar-inner">
			<div class="container-fluid">
				<a class="brand" href="#">phpRPG AdminCP</a>
				<ul class="nav">

OUT;
		ksort($module->tabs);
		foreach($module->tabs as $tabrange){
			foreach($tabrange as $tab){
				echo "					<li".(($module->curModule['name'] != $tab['module'])?"":" class=\"active\"")."><a href=\"index.php?module=".$tab['module']."\">".$tab['name']."</a></li>\n";
			}
		}
		echo <<<OUT
				</ul>
				<p class="pull-right"><a href="{$phprpg->settings['gameurl']}">Back to game</a></p>
			</div>
		</div>
	</div>

	<div class="container-fluid">
		<div class="sidebar">
			<div class="well">
				<h5>Links</h5>
				<ul>

OUT;
		$links = $module->curModule['class']->links();
		ksort($links);
		foreach($links as $link){
			echo "					<li><a href=\"".$link['url']."\">".$link['title']."</a></li>\n";
		}
		echo <<<OUT
				</ul>
			</div>
		</div>
		<div class="content">
OUT;
	}
	public function footer(){
		echo <<<OUT
			<footer>
				<p>Copyright &copy; 2011+ phpRPG</p>
			</footer>
		</div>
	</div>

	
</body></html>
OUT;
	}
}
?>